<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Tabs http://www.codefans.net</title>
<script type="text/javascript" src="Js/jquery.js"></script>
<script type="text/javascript" src="tab.js"></script>
<!--<script type="text/javascript" src="../scripts/gcn/jquery.contextmenu.r2.js"></script>-->
<style type="text/css">
@IMPORT url("imgs/tab.css");
body{margin:0;padding:0;}
h2 {
	background-color: #cccccc;
	padding: 0px;
	font-size: 18px;
	font-family: "黑体";
}

#tab_menu {
	padding: 0px;
	width: 99%;
	height: 100%;
	overflow: hidden;
}

#page {
	width: 100%;
	height: 500px;
	overflow:hidden;
	border: solid 1px #cccccc;
	/*height: expression(parentNode . parentNode . offsetHeight-25);*/

}
</style>
<script language="javascript">
var tab=null;
$( function() {
	  tab = new TabView( {
		containerId :'tab_menu',
		pageid :'page',
		cid :'tab_po',
		position :'top'
	});
	tab.add( {
		id :'tab1_id_index1',
		title :"工作台",
		url :"../frame/main_temp.html",
		isClosed :false
	});
	tab.add( {
		id :'tab1_id_index2',
		title :"工作台",
		url :"../frame/main_temp.html",
		isClosed :true
	});
});

var index=1;

function addTab(tabtitle,taburl){
	
	var hiddentitles = document.getElementById("hiddentitles");
	//alert(hiddentitles.value);
	var ishave = hiddentitles.value.indexOf(tabtitle+",");
	if(ishave == -1){
		var id='tab5_id_index'+(index+12);
		var name = tabtitle;
		var url= taburl;
		var close= '1';
		tab.add( {
			id :id,
			title :name==""?("标签页面"+(index+1)):name,
			url :url==""?("tabs/tab"+((index%3)+1)+".html"):url,
			isClosed :close=='1'?true:false
		});
		index++;
		hiddentitles.value = hiddentitles.value +  id + "|" +tabtitle + "," ;
	} 
}

/**
$(document).ready(function(){  
		
    $("a").contextMenu('pageitem', { //点击所有Span标签都会弹出右键菜单   
  		onShowMenu: function(e, menu) {  
  			//alert($(e.target).attr('id'));  
        return menu;   
      },                 
      bindings: {   
        'item_1': function(t) {   
          alert('1');   
        },   
        'item_2': function(t) {   
          alert('2');   
        },   
        'item_3': function(t) { //id为standmk的菜单项被点后   
            alert('3');   
              //t.id指示出被点的标签的id属性   
        }   
      } 
     });  
});  
*/
</script>
</head>
<!--
<div class="contextMenu" id="pageitem">
    <ul>
      <li id="close_item">关闭</li>
      <li id="closeother_item">关闭其他</li>
      <li id="refrese_item">刷新</li>
    </ul>
</div>
-->
<body>
<div id="tab_menu"></div>
<div id="page"></div>
<input type="hidden" id="hiddentitles" name="hiddentitles" value=""/>
</body>
</html>